package com.xl.random;

import java.util.Random;

public class RandomDemo {
    public static void main(String[] args) {
        Random random = new Random();
        for (int i=0; i<20; i++) {
            int data = random.nextInt(10);
            System.out.println(data);
        }

        System.out.println("--------------");
        for (int i=0; i<20; i++) {
            // 1-10 就是0-9 再加1 0-9就是next(10)
            int data = random.nextInt(10)+1;
            System.out.println(data);
        }
    }
}
